<?php
include_once('code_parents.php');
class code_user_tag extends code_parents {
	private $CI;
	private $baseUrl;
	function __construct() {
		$CI = & get_instance ();
		$this->CI = $CI;
		$CI->load->helper ( 'url' );
		$this->baseUrl = $CI->config->base_url ();
	}
	
	function userTag(){
	
		return  $this->personalTag().$this->personalSex().$this->personalBirthday().$this->personalAddress().$this->personalNowAddress();
	}
	
	function personalTag(){
	
		$userTags  = "<div class='zw_bq'><strong>标签：</strong>";
		$userTag   = $this->CI->session->userdata("tag");
		$userTag   = empty($userTag) ? "待完善" : $userTag; 
		$array = explode(" ",$userTag);
		
		foreach($array as $key=>$val) {
			
			$userTags.= "<p>".$val."</p>";
		}
		//
		return  $userTags."</div>";
	}
	function personalSex(){
	
		$userSex = $this->CI->session->userdata("sex");
		$userSex = empty($userSex) ? "男" : $userSex;
		return  "<div class='zw_d01'><strong>性别：</strong><div class='zhiwo_txt_l'></div><div class='zhiwo_txt_c' id = 'userSex' contenteditable='true'>$userSex</div><div class='zhiwo_txt_r'></div></div>";
	}
	function personalBirthday(){
	
		$userBirthday = $this->CI->session->userdata("birthday");
		$userBirthday = empty($userBirthday) ? "待完善" : $userBirthday;
		return "<div class='zw_d01'><strong>生日：</strong><div class='zhiwo_txt_l'></div><div class='zhiwo_txt_c' id = 'userBirthday' contenteditable='true'>$userBirthday</div><div class='zhiwo_txt_r'></div></div>";
	}
	function personalAddress(){
	
		$userAddress = $this->CI->session->userdata("detailAddress");
		$userAddress = empty($userAddress) ? "待完善" : $userAddress;
		return "<div class='zw_d01'><strong>出生地：</strong><div class='zhiwo_txt_l'></div><div class='zhiwo_txt_c' id = 'userAddress' contenteditable='true'>$userAddress</div><div class='zhiwo_txt_r'></div></div>";
	}
	function personalNowAddress(){
	
		$userNowAddress = $this->CI->session->userdata("nowAddress");
		$userNowAddress = empty($userNowAddress)? "待完善" : $userNowAddress;
		return "<div class='zw_d01'><strong>现居住地：</strong>	<div class='zhiwo_txt_l'></div><div class='zhiwo_txt_c' id = 'userNowAddress' contenteditable='true'>$userNowAddress</div><div class='zhiwo_txt_r'></div></div>";
	}
}
